﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace YiNing.Tools
{
    public class LogHelper
    {
        static readonly log4net.ILog logInfo = log4net.LogManager.GetLogger("loginfo");
        static readonly log4net.ILog logError = log4net.LogManager.GetLogger("logerror");

        public static void WriteLog(string info, bool warm = false)
        {
            if (logInfo.IsInfoEnabled)
            {
                if (warm) logInfo.Warn(info);
                else
                    logInfo.Info(info);
            }
        }

        public static void WriteLog(string info, Exception ex)
        {
            if (logError.IsErrorEnabled)
            {
                logError.Error(info, ex);
            }
        }
        public static void WriteLogD(string info)
        {
            if (logInfo.IsInfoEnabled)
            {
                logInfo.Debug(info);
            }
        }
    }
}
